package cool.taomu.software.fig.spring.example;

import java.io.IOException;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

import cool.taomu.software.fig.core.FigCore;
import cool.taomu.software.fig.mqtt.broker.MQTTBroker;
import cool.taomu.software.fig.springutils.RegisterBeanToSpring;

/***
 * @author rcmu
 */
@SpringBootApplication
@ComponentScan("cool.taomu.software.fig.spring.example")
public class DemoMain {

	public static void main(String[] args) throws InterruptedException, IOException {
		RegisterBeanToSpring.setSpring(SpringApplication.run(DemoMain.class, new String[] {}));
		// TimeUnit.SECONDS.sleep(20);
		FigCore.startServer(args);
		FigCore.startClient(args,Example.class);
		/*
		 * MQTTSender sender = new MQTTSender(); sender.publish( new
		 * SenderEntity("start").broker("127.0.0.1:1883").username("admin").password(
		 * "123456").message(""));
		 */

	}
}
